home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / tcprogud.sit / picture ƒ / picthelp < prev    next >
Text File  |  1991-02-25  |  7KB  |  163 lines

  1. Help file for the "Picture" project.
  2.  
  3. Ralph Gonzalez, PO Box 54, Newark, DE 19711, USA.
  4.  
  5.  
  6.  
  7. INTRODUCTION:
  8.  
  9. Picture is a class library for displaying and animating three-
  10. dimensional color wire-frame drawings, although it may also be used for 
  11. displaying two-dimensional drawings.  It supports segmentation of 
  12. graphical entities, multiple viewpoints and multiple projection windows, 
  13. and animation with an independent frame of reference for each (nested) 
  14. segment.  It was written with the object-oriented Think C 4.0 compiler 
  15. by Symantec Corp., using Macintosh computers.  However, the code 
  16. includes conditional compilation directives to allow compilation on any 
  17. computer with a C++ compiler, provided a Screen class has been written 
  18. for this computer.  Presently Screen classes for Macintosh and IBM PC 
  19. (EGA/VGA) computers exist, although I hope to produce one for the X 
  20. Window system soon so the code can be used on any workstation using X 
  21. Window.  (Note: the PC-specific code was written with the Turbo C++ 
  22. compiler, and requires the presence of the file egavga.bgi in the 
  23. working directory.)
  24.  
  25.  
  26. DISTRIBUTION:
  27.  
  28. Picture may be distributed freely as long as this Help file is included.  
  29. It is intended for educational use, although you may adapt if for 
  30. commercial use if you find it useful.  I would appreciate well-
  31. documented copies of any Picture applications you come up with.  Users 
  32. are also encouraged to add functionality to the existing Picture 
  33. library, or to write new Screen classes for other computers.  Please 
  34. send any such additions to me, including documentation, so I can include 
  35. them for distribution.
  36.  
  37.  
  38. DESCRIPTION:
  39.  
  40. Picture consists of the following major classes:  Camera, Frame, 
  41. Projector, Screen, Segment, and Transformation.  All of these are 
  42. descendants of a Generic_Class.
  43.  
  44. Three-dimensional figures are defined by creating new classes which are 
  45. descendants of the Segment class.  An existing descendant of Segment is 
  46. Nested_Segment.  Figures which are defined as descendants of 
  47. Nested_Segments can easily be composed of combinations of existing 
  48. figures.  An existing descendant of Nested_Segment is Animated_Segment.  
  49. Figures which derive from this class can define animate() methods which 
  50. indicate how the nested segments are to be animated.
  51.  
  52. Segments can be moved and animated using Transformations, including 
  53. scaling, translation, and rotation about the coordinate axes.
  54.  
  55. Camera objects are positioned and oriented in three dimensions to serve 
  56. as viewpoints.  A rectangular cropping region (or Frame) on the Camera's 
  57. projection plane declares the size of the "photo" for use with a 
  58. Projector, as mentioned below.
  59.  
  60. Each application should contain a single "screen" object (whose class is 
  61. a descendant of Screen) which is appropriate for the hardware 
  62. configuration (although it may be possible to allow multiple screen 
  63. objects, for situations where multiple monitors are available).  
  64. Presently there exist Mac_Screen and PC_Screen classes, although it is 
  65. hoped that more will become available in the future.  The application 
  66. may contain several Projector objects, each of which is associated with 
  67. a rectangular window (or Frame) on the Screen.  The application may also 
  68. contain several Camera objects and Segments.  Segments are drawn by 
  69. specifying which Camera and which Projector to use.  Segments may be 
  70. drawn repeatedly in a loop to obtain animation.
  71.  
  72. A class called Generic_Pict serves as a generic Picture application, 
  73. which defines Screen, Error, and Backdrop_Projector (black backdrop) 
  74. objects.  The easiest way to create a new Picture application is to 
  75. define a new class which inherits these properties from Generic_Pict and 
  76. overrides the init(), run(), and destroy() methods (calling the 
  77. inherited ones as well) to draw specialized figures.  These specialized 
  78. figures should be defined elsewhere as subclasses of Segment.  Note that 
  79. the Error object automatically reports errors to the file error.fil.  
  80. Examine this file after running the application to aid debugging.  Three 
  81. example applications are included.
  82.  
  83.  
  84. FILES:
  85.  
  86. picthelp    this file
  87.  
  88. (The following files comprise the Picture library.  Please read the 
  89. comments in the source and header files of any classes you will 
  90. override, especially Generic_Pict.)
  91.  
  92. class.h        defines Generic_Class, from which all classes derive.  
  93.         Also includes declarations for Think C/C++ compatibility
  94. class.c        methods for Generic_Class
  95. error.h        defines Error class, for reporting certain errors to 
  96.         error.fil
  97. error.c        Error methods
  98. screen.h    defines Screen and machine-specific Mac_Screen and 
  99.         PC_Screen, which encapsulate all machine-specific code.
  100. screen.c    methods for Screen and descendants
  101. color.h        defines mapping of color values, for color or B&W 
  102.         displays
  103. camera.h    defines Camera class representing the viewpoint for 3D
  104.         perspective projection
  105. camera.c    Camera methods
  106. project.h    defines Projector class representing the mapping from
  107.         the Camera's projection plane to a screen window
  108. project.c    Projector methods
  109. backdrop.h    defines Backdrop_Projector, which simply fills the 
  110.         entire screen with a single color to hide the operating 
  111.         system desktop
  112. backdrop.c    Backdrop_Projector methods
  113. coord.h        defines Coord2 and Coord3 classes for 2D and 3D 
  114.         coordinates
  115. coord.c        defines operations on Coord2 and Coord3 objects
  116. trans.h        defines Transformation class and descendants:     
  117.         Translation, Scaling, Rotation_X, Rotation_Y, and 
  118.         Rotation_Z.  Also a composite transformation for 3D 
  119.         perspective transformation.
  120. trans.c        methods for these transformation classes
  121. frame.h        defines the Frame class, for 2D mappings
  122. frame.c        methods for Frame
  123. segment.h    defines Segment and Nested_Segment for defining figures
  124. segment.c    Segment methods
  125. line.h        defines Line class, a simple Segment descendant
  126. line.c        Line methods
  127. cube.h        defines Cube, a descendant of Nested_Segment consisting 
  128.         of several Lines.  Also defines Fast_Cube, a descendant 
  129.         of Segment which draws faster
  130. cube.c        Cube methods
  131. ring.h        defines Ring, a Nested_Segment descendant for ring-    
  132.         shaped collections of Cubes
  133. ring.c        Ring methods
  134. animate.h    defines Animated_Segment class, a Nested_Segment 
  135.         descendant for defining animations of nested segments
  136. animate.c    Animated_Segment methods
  137. atring.h    defines Atomic_Ring, an Animated_Segment descendant very
  138.         similar to Ring
  139. atring.c    Atomic_Ring methods
  140. anring.h    defines Animated_Ring, an Animated_Segment whose nested
  141.         segments may also be animated
  142. anring.c    Animated_Ring methods
  143. pict.h        defines Generic_Pict, a generic class from which the 
  144.         main application class should be derived.
  145. pict.c        Generic_Pict methods
  146.  
  147. (The following files are used to demonstrate how to use the Picture 
  148. library.  Simple_Pict, Ring_Pict, and An_Ring_Pict are sample animated 
  149. pictures derived from Generic_Pict.  Comments in these files indicate 
  150. how to compile the applications.)
  151.  
  152. simpict.h    defines Simple_Pict, a sample 2D picture
  153. simpict.c    Simple_Pict methods plus main() function
  154. ringpict.h    defines Ring_Pict, a sample 3D picture
  155. ringpict.c    Ring_Pict methods plus main() function
  156. anringpi.h    defines An_Ring_Pict, a sample animated 3D picture
  157. anringpi.c    An_Ring_Pict methods plus main() function
  158.  
  159.  
  160. REFERENCES:
  161.  
  162. Hearn & Baker, "Computer Graphics", Prentice-Hall, 1986
  163.